import React from 'react'
import { HashRouter,Redirect,Route, Switch } from 'react-router-dom'
import Login from '../pages/login/Login'
import SandBox from '../pages/sandbox/SandBox'
export default function IndexRouter() {
  return (
    <HashRouter>
      <Switch>
        <Route path="/login" component={Login} />
        <Route path="/" render={()=>
          localStorage.getItem('token')?<SandBox/>:<Redirect to="/login" />
        } />
      </Switch>
    </HashRouter>
  )
}
